This repository was archived by the owner on Feb 22, 2023. It is now read-only.
[webview_flutter] Update Widget Unit Tests to be platform agnostic#4489
Merged
bparrishMines merged 4 commits intoflutter:masterfrom Nov 12, 2021
Merged
[webview_flutter] Update Widget Unit Tests to be platform agnostic#4489bparrishMines merged 4 commits intoflutter:masterfrom
bparrishMines merged 4 commits intoflutter:masterfrom
Conversation
bparrishMines
commented
Nov 9, 2021
| expect(await controller!.currentUrl(), equals('https://flutter.io')); | ||
| }); | ||
|
|
||
| testWidgets("Can't go back before loading a page", |
Contributor
Author
There was a problem hiding this comment.
This test was removed since it only tests the behavior of a fake Platform WebView and not the behavior of the WebView widget.
bparrishMines
commented
Nov 9, 2021
| expect(fakePlatformViewsController.lastCreatedView!.hasCache, false); | ||
| }); | ||
|
|
||
| testWidgets("Can't go back with no history", (WidgetTester tester) async { |
Contributor
Author
There was a problem hiding this comment.
I removed this test for the same reason as the one above.
| expect(canGoBackSecondPageLoaded, true); | ||
| }); | ||
|
|
||
| testWidgets("Can't go forward before loading a page", |
Contributor
Author
There was a problem hiding this comment.
I removed this test for the same reason as the one above.
bparrishMines
commented
Nov 9, 2021
| when(mockWebViewPlatform.clearCookies()) | ||
| .thenAnswer((_) => Future<bool>.value(true)); | ||
|
|
||
| testWidgets('Second cookie clear does not have cookies', |
Contributor
Author
There was a problem hiding this comment.
I removed this test for the same reason as the one above.
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Nov 12, 2021
amantoux
pushed a commit
to amantoux/plugins
that referenced
this pull request
Dec 11, 2021
KyleFin
pushed a commit
to KyleFin/plugins
that referenced
this pull request
Dec 21, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As discussed in #4455 (comment), many of the unit tests for
webview_flutteruseAndroidViewandMethodChannelWebViewPlatformas default platform implementations. Sincewebview_flutteris moving away from using a defaultMethodChannelimplementation, many of the tests break when Android uses its own implementation.This PR replaces
WebView.platformwith aMockWebViewPlatformand uses aMockWebViewPlatformController.Pre-launch Checklist
dart format.)[shared_preferences]///).If you need help, consider asking for advice on the #hackers-new channel on Discord.